package cn.enjoy.design.create.factory.abstractFactory.factory;

import cn.enjoy.design.create.factory.abstractFactory.product2.Green;
import cn.enjoy.design.create.factory.abstractFactory.product1.Shape;
import cn.enjoy.design.create.factory.abstractFactory.product2.Blue;
import cn.enjoy.design.create.factory.abstractFactory.product2.Color;
import cn.enjoy.design.create.factory.abstractFactory.product2.Red;

/**
 * @author K
 * @date 2021/5/22 下午4:42
 */
public class ColorFactory extends AbstractFactory {

    @Override
    public Shape getShape(String shapeType){
        return null;
    }

    @Override
    public Color getColor(String color) {
        if(color == null){
            return null;
        }
        if(color.equalsIgnoreCase("RED")){
            return new Red();
        } else if(color.equalsIgnoreCase("GREEN")){
            return new Green();
        } else if(color.equalsIgnoreCase("BLUE")){
            return new Blue();
        }
        return null;
    }
}
